package com.sxm.yiwei.activitis;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sxm.yiwei.MainActivity;
import com.sxm.yiwei.R;
import com.sxm.yiwei.tools.CastTime;

/**
 * 公告详情 意见建议详情
 *
 */
public class NoticeItemContentTwoActivity extends BaseActivity implements View.OnClickListener{

    private ImageView workback;
    private TextView backtime;
    private TextView noadvice;
    private TextView metime;
    private TextView backcontent;
    private ImageView backmain;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fw_work);
        Intent intent = getIntent();
        String result = intent.getStringExtra("result");
        String time = intent.getStringExtra("time");
        String resulttime = intent.getStringExtra("resulttime");
        String adavice = intent.getStringExtra("advice");
        initWorkView();
        backtime.setText(CastTime.startTime(Long.valueOf(resulttime)));
        backcontent.setText(result);
        metime.setText(CastTime.startTime(Long.valueOf(time)));
        noadvice.setText(adavice);
    }

    private void initWorkView() {
        backmain = (ImageView) findViewById(R.id.msgnoticeitem_backmain);
        workback = (ImageView) findViewById(R.id.work_back);
        backtime = (TextView) findViewById(R.id.noticecontenttwo_backtime);
        noadvice = (TextView) findViewById(R.id.noticecontenttwo_meadvice);
        metime = (TextView) findViewById(R.id.noticecontenttwo_metime);
        backcontent = (TextView) findViewById(R.id.noticecontent_backcontent);


        // 设置监听事件
        workback.setOnClickListener(this);
        backmain.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.work_back:
                finish();
                break;
            case R.id.msgnoticeitem_backmain:
                startActivity(new Intent(NoticeItemContentTwoActivity.this, MainActivity.class));
                AppManager.getAppManager().finishAllActivity();
                break;
        }
    }
}
